load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "expression",
    srcs = [
        "builtin.go",
        "builtin_arithmetic.go",
        "builtin_arithmetic_vec.go",
        "builtin_cast.go",
        "builtin_cast_vec.go",
        "builtin_compare.go",
        "builtin_compare_vec.go",
        "builtin_compare_vec_generated.go",
        "builtin_control.go",
        "builtin_control_vec_generated.go",
        "builtin_convert_charset.go",
        "builtin_encryption.go",
        "builtin_encryption_vec.go",
        "builtin_fts.go",
        "builtin_func_param.go",
        "builtin_grouping.go",
        "builtin_ilike.go",
        "builtin_ilike_vec.go",
        "builtin_info.go",
        "builtin_info_vec.go",
        "builtin_json.go",
        "builtin_json_vec.go",
        "builtin_like.go",
        "builtin_like_vec.go",
        "builtin_math.go",
        "builtin_math_vec.go",
        "builtin_miscellaneous.go",
        "builtin_miscellaneous_vec.go",
        "builtin_op.go",
        "builtin_op_vec.go",
        "builtin_other.go",
        "builtin_other_vec.go",
        "builtin_other_vec_generated.go",
        "builtin_regexp.go",
        "builtin_regexp_util.go",
        "builtin_string.go",
        "builtin_string_vec.go",
        "builtin_string_vec_generated.go",
        "builtin_threadsafe_generated.go",
        "builtin_threadunsafe_generated.go",
        "builtin_time.go",
        "builtin_time_vec.go",
        "builtin_time_vec_generated.go",
        "builtin_vec.go",
        "builtin_vec_vec.go",
        "builtin_vectorized.go",
        "chunk_executor.go",
        "collation.go",
        "column.go",
        "constant.go",
        "constant_fold.go",
        "constant_propagation.go",
        "context.go",
        "distsql_builtin.go",
        "errors.go",
        "evaluator.go",
        "explain.go",
        "expr_to_pb.go",
        "expression.go",
        "extension.go",
        "fts_helper.go",
        "function_traits.go",
        "grouping_sets.go",
        "helper.go",
        "infer_pushdown.go",
        "scalar_function.go",
        "schema.go",
        "simple_rewriter.go",
        "util.go",
        "vectorized.go",
        "vs_helper.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/expression",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/config",
        "//pkg/errctx",
        "//pkg/errno",
        "//pkg/expression/exprctx",
        "//pkg/expression/expropt",
        "//pkg/extension",
        "//pkg/infoschema/context",
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/param",
        "//pkg/parser",
        "//pkg/parser/ast",
        "//pkg/parser/auth",
        "//pkg/parser/charset",
        "//pkg/parser/mysql",
        "//pkg/parser/opcode",
        "//pkg/parser/terror",
        "//pkg/parser/types",
        "//pkg/planner/cascades/base",
        "//pkg/sessionctx/stmtctx",
        "//pkg/sessionctx/vardef",
        "//pkg/sessionctx/variable",
        "//pkg/store/helper",
        "//pkg/tablecodec",
        "//pkg/types",
        "//pkg/types/parser_driver",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/context",
        "//pkg/util/dbterror",
        "//pkg/util/dbterror/plannererrors",
        "//pkg/util/disjointset",
        "//pkg/util/encrypt",
        "//pkg/util/generatedexpr",
        "//pkg/util/hack",
        "//pkg/util/intest",
        "//pkg/util/intset",
        "//pkg/util/logutil",
        "//pkg/util/mathutil",
        "//pkg/util/parser",
        "//pkg/util/password-validation",
        "//pkg/util/plancodec",
        "//pkg/util/printer",
        "//pkg/util/redact",
        "//pkg/util/sem/compat",
        "//pkg/util/set",
        "//pkg/util/size",
        "//pkg/util/sqlexec",
        "//pkg/util/stringutil",
        "//pkg/util/timeutil",
        "//pkg/util/vitess",
        "//pkg/util/zeropool",
        "@com_github_gogo_protobuf//proto",
        "@com_github_google_uuid//:uuid",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_kvproto//pkg/kvrpcpb",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_qri_io_jsonschema//:jsonschema",
        "@com_github_tikv_client_go_v2//oracle",
        "@org_uber_go_atomic//:atomic",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "expression_test",
    timeout = "moderate",
    srcs = [
        "bench_test.go",
        "builtin_arithmetic_test.go",
        "builtin_arithmetic_vec_test.go",
        "builtin_cast_bench_test.go",
        "builtin_cast_test.go",
        "builtin_cast_vec_test.go",
        "builtin_compare_test.go",
        "builtin_compare_vec_generated_test.go",
        "builtin_compare_vec_test.go",
        "builtin_control_test.go",
        "builtin_control_vec_generated_test.go",
        "builtin_encryption_test.go",
        "builtin_encryption_vec_test.go",
        "builtin_grouping_test.go",
        "builtin_ilike_test.go",
        "builtin_info_test.go",
        "builtin_info_vec_test.go",
        "builtin_json_test.go",
        "builtin_json_vec_test.go",
        "builtin_like_test.go",
        "builtin_like_vec_test.go",
        "builtin_math_test.go",
        "builtin_math_vec_test.go",
        "builtin_miscellaneous_test.go",
        "builtin_miscellaneous_vec_test.go",
        "builtin_op_test.go",
        "builtin_op_vec_test.go",
        "builtin_other_test.go",
        "builtin_other_vec_generated_test.go",
        "builtin_other_vec_test.go",
        "builtin_regexp_test.go",
        "builtin_regexp_vec_const_test.go",
        "builtin_string_test.go",
        "builtin_string_vec_generated_test.go",
        "builtin_string_vec_test.go",
        "builtin_test.go",
        "builtin_time_test.go",
        "builtin_time_vec_generated_test.go",
        "builtin_time_vec_test.go",
        "builtin_vec_vec_test.go",
        "builtin_vectorized_test.go",
        "collation_test.go",
        "column_test.go",
        "constant_test.go",
        "distsql_builtin_test.go",
        "evaluator_test.go",
        "expr_to_pb_test.go",
        "expression_test.go",
        "function_traits_test.go",
        "grouping_sets_test.go",
        "helper_test.go",
        "main_test.go",
        "scalar_function_test.go",
        "schema_test.go",
        "simple_rewriter_test.go",
        "typeinfer_test.go",
        "util_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":expression"],
    flaky = True,
    race = "on",
    shard_count = 50,
    deps = [
        "//pkg/config",
        "//pkg/errctx",
        "//pkg/errno",
        "//pkg/expression/exprctx",
        "//pkg/expression/exprstatic",
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/parser",
        "//pkg/parser/ast",
        "//pkg/parser/auth",
        "//pkg/parser/charset",
        "//pkg/parser/mysql",
        "//pkg/parser/terror",
        "//pkg/planner/cascades/base",
        "//pkg/planner/core",
        "//pkg/planner/core/resolve",
        "//pkg/session",
        "//pkg/sessionctx/stmtctx",
        "//pkg/sessionctx/vardef",
        "//pkg/sessionctx/variable",
        "//pkg/sessiontxn",
        "//pkg/tablecodec",
        "//pkg/testkit",
        "//pkg/testkit/testmain",
        "//pkg/testkit/testsetup",
        "//pkg/testkit/testutil",
        "//pkg/types",
        "//pkg/types/parser_driver",
        "//pkg/util",
        "//pkg/util/benchdaily",
        "//pkg/util/chunk",
        "//pkg/util/codec",
        "//pkg/util/collate",
        "//pkg/util/context",
        "//pkg/util/hack",
        "//pkg/util/mathutil",
        "//pkg/util/mock",
        "//pkg/util/printer",
        "//pkg/util/sqlkiller",
        "//pkg/util/timeutil",
        "@com_github_gogo_protobuf//proto",
        "@com_github_google_uuid//:uuid",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@com_github_pingcap_tipb//go-tipb",
        "@com_github_stretchr_testify//require",
        "@com_github_tikv_client_go_v2//oracle",
        "@com_github_tikv_client_go_v2//tikv",
        "@io_opencensus_go//stats/view",
        "@org_uber_go_atomic//:atomic",
        "@org_uber_go_goleak//:goleak",
    ],
)
